package io.gitee.zhangbinhub.acp.boot.exceptions

import io.gitee.zhangbinhub.acp.core.common.base.BaseException
import org.springframework.http.HttpStatus

class WebException : BaseException {
    var httpStatus = HttpStatus.BAD_REQUEST

    constructor(message: String?) : super(message)

    constructor(httpStatus: HttpStatus?, message: String?) : this(message) {
        this.httpStatus = httpStatus ?: HttpStatus.BAD_REQUEST
    }

    override fun toString(): String {
        return "[$httpStatus] ${this.javaClass.canonicalName}: ${this.message}"
    }
}
